package com.njlime.member.repository.sms;

import com.njlime.core.helper.PageBean;
import com.njlime.member.entiies.TMember;
import com.njlime.member.entiies.TMemberGroup;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Map;

/**
 * Created by Dean on 2017-7-27.
 */
public interface MemberGroupDao extends JpaRepository<TMemberGroup, Integer>,JpaSpecificationExecutor<TMemberGroup> {

    public List<TMemberGroup> list(TMemberGroup member  );

    public TMemberGroup getMaxGroupId(int unitId);

    public Map getSumMember(TMemberGroup info);

    public void edit(TMemberGroup info);

    /**
     * 减少分组下的数量
     * @param newsGroupId
     */
    public void downCount(Integer newsGroupId, int unitId);
    /**
     * 增加分组下的数量
     * @param newsGroupId
     */
    void upCount(Integer newsGroupId, int unitId);

    void deleteGroup(String id, int unitId);
}
